﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="binDingCard.aspx.cs" Inherits="Service_binDingCard" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"
        charset="utf-8" />
    <title></title>
    <script src="jquery-1.11.2.min.js"></script>
    <script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script src="script/common.js"></script>
    <script src="script/wx_share_card.js"></script>



    <script>
        function binding() {

            var id = getQueryString("id");
            if (id) {
                var phone = $("#memname").val();
                var mempws = $("#mempws").val();
        
                if (phone.length!=11) {
                    alert("电话错误");
                    return
                }
                if (mempws.length<6 || mempws.length>12) {
                    alert("密码长度不能大于12位小于6位!")
                    return
                }
                $.get("../Service/AjaxService.ashx?Method=binDingCard",
                {
                    "id": id,
                    "phone": phone,
                    "mempws": mempws
                }
                , function (text) {
                  
                    if (text=="0") {
                        alert("系统繁忙，稍后再试！");
                        return;
                    } else if (text=="1") {
                        alert("会员卡已被领取！")
                        return;
                    } else if (text == "-2") {
                        alert("手机号已经被使用！")
                        return;
                    } else {
                        alert("绑定成功！您的卡号是" + text + "！")
                        window.location.href = "login.aspx";
                        return;
                        
                    }


                }, "text")
            }
            else {
                alert("页面已经过期");
            }






        }
        $(function () {
            pushHistory();
            var bool = false;
            setTimeout(function () {
                bool = true;
            }, 100);
            window.addEventListener("popstate", function (e) {
                if (bool) {

                    location.href = 'index.aspx';
                }
                pushHistory();

            }, false);
        });
        function pushHistory() {
            var state = {
                title: "title",
                url: "#"
            };
            window.history.pushState(state, "title", "#");
        }
    </script>
    <link href="New/css/index.css" rel="stylesheet" />
    <link href="New/css/login.css" rel="stylesheet" />

    <style type="text/css">
        * {
            margin: 0px;
            padding: 0px;
            list-style: none;
        }

        a, img, button, input, textarea {
            -webkit-tap-highlight-color: rgba(255,255,255,0);
        }

            a:active {
                outline: hidden;
            }

        .a_header {
            width: 100%;
            height: 50px;
            background: #fff;
            position: fixed;
            top: 0px;
            left: 0px;
            border-bottom: 1px solid #ddd;
        }

            .a_header .header_middle {
                width: 100%;
                height: 50px;
                line-height: 50px;
                text-align: center;
                font-size: 20px;
            }

            .a_header .a_header_l1 .h_l1 {
                width: 35px;
                height: 25px;
                background: url("../images/header_02.png") no-repeat;
                background-size: 10px 15px;
                margin: 16px 0px 0px 15px;
                position: absolute;
            }

            .a_header .a_header_l1 .h_l2 {
                width: 60px;
                height: 45px;
                position: fixed;
                left: 35px;
                top: 16px;
                color: #000;
                font-size: 14px;
            }

        body {
            background: #f0f0f0;
        }

        .content {
            padding-top: 27%;
        }

        #forget_pwd_a {
            font-size: 12px;
            color: #000;
        }

            #forget_pwd_a:hover {
                color: #f00;
            }

        .imageslogo {
            margin-top: 27%;
            text-align: center;
            height: 30%;
            width: 30%;
            border-radius: 100px;
        }

        .title {
            padding-top: 15%;
            text-align: center;
            color: red;
            font-weight: bold;
            font-size: 18px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div id="jssdkurl" style="display: none"><%=jssdkurl %></div>
        <div class="title">
            绑定☆会员卡
       
        </div>

        <div class="content">
            <div class="cont_middle">
                <div class="cont_middle_1">
                    <li>
                        <div class="co_mid_left">
                            <img src="New/images/my_04.png" />
                        </div>
                    </li>
                    <li>
                        <div class="co_mid_right">
                            <input type="text" placeholder="请输入手机号" id="memname" />
                            
                        </div>
                    </li>
                </div>
                 <div class="cont_middle_1">
                    <li>
                        <div class="co_mid_left">
                            <img src="New/images/my_06.png" />
                        </div>
                    </li>
                    <li>
                        <div class="co_mid_right">
                            <input type="password" placeholder="请输入密码" id="mempws" />
                            
                        </div>
                    </li>
                </div> 
                <div class="cont_footer">

                    <div class="cont_footer_all">
                        <div class="cont_footer_1" style="width: 100%;">

                            <div class="cont_footer_1_1" id="loginSumbit" onclick="binding()">
                                点击绑定
                            </div>
                            
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </form>
</body>
</html>
